<?php
$db->mysqlDB->falseAutoCommit();

$params = $route->bodyParams;

$params['oim_type'] = 0;
$R1 = $db->mysqlDB->automaticAdd($params)->insertTransaction("easyd_oa_internal_mail");

$params['oim_type'] = 1;
$params['oim_fid'] = $R1;
$R2 = $db->mysqlDB->automaticAdd($params)->insertTransaction("easyd_oa_internal_mail");

if(!$R1||!$R2){
    $db->mysqlDB->rollBackCommint();
    $db->mysqlDB->trueAutoCommit();
    $response->responseData( false );
}else{
    $db->mysqlDB->actionCommint();
    $db->mysqlDB->trueAutoCommit();
    $response->responseData( true );
}

?>